﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CMS.IRepository;


namespace CMS.Repository
{
    public class LevelRepository : ILevelRepository
    {
        /// <summary>
        /// Selects all levels from database.
        /// </summary>
        /// <returns>List of Level</returns>
        public List<Model.Level> SelectAllLevels()
        {
            List<Level> levelList = new List<Level>();
            using (var cmsContext = new CMSEntities())
            {
                var levels = from level in cmsContext.Levels
                             select level;
                levelList = levels.ToList();
            }
            return Translator.LevelTranslator.ToLevelModelList(levelList);
        }
    }
}
